#include <bits/stdc++.h>

using namespace std;

class Solution
{
public:
    uint32_t reverseBits(uint32_t n)
    {
        uint32_t ret = 0;
        uint32_t tmp = 0;
        for (int i = 0; i < 31; ++i)
        {
            ret |= (n >> i) & 1;
            ret <<= 1;
        }
        ret |= ((n >> 31) & 1);
        return ret;
    }
};